import Constant from './constant.js';

var Config = {
    SAVE_BEST_SCORE: 'SAVE_BEST_SCORE',
    SAVE_CURRENT_SCORE: 'SAVE_CURRENT_SCORE',
    SAVE_CURRENT_SCORE_INFINITE: 'SAVE_CURRENT_SCORE',
    SAVE_GAME_DIFFICULTY: 'SAVE_GAME_DIFFICULTY',
    SAVE_GAME_VOLUME_STATE: 'SAVE_GAME_VOLUME_STATE',
    SAVE_GET_GOAL_TIME: 'SAVE_GET_GOAL_TIME',
    SAVE_CURRENT_GAME_MODE: 'SAVE_CURRENT_GAME_MODE',
    KEY_GAME_VOLUME_STATE: 'KEY_GAME_VOLUME_STATE',
    KEY_GET_GOAL_TIME: 'KEY_GET_GOAL_TIME',
    KEY_CURRENT_GAME_MODE: 'KEY_CURRENT_GAME_MODE',
    KEY_BEST_SCORE_WITHIN_4: 'KEY_BEST_SCORE_WITHIN_4',
    KEY_BEST_SCORE_WITHIN_5: 'KEY_BEST_SCORE_WITHIN_5',
    KEY_BEST_SCORE_WITHIN_6: 'KEY_BEST_SCORE_WITHIN_6',
    KEY_BEST_SCORE_WITHIN_INFINITE: 'KEY_BEST_SCORE_WITHIN_INFINITE',
    KEY_GAME_DIFFICULTY: 'KEY_GAME_DIFFICULTY',
    KEY_CURRENT_GAME_DATA: 'KEY_CURRENT_GAME_DATA',
    BestScore: 0, //最高得分
    BestScoreWithinInfinite: 0, //无限模式下最高分
    GRIDColumnCount: 4, //方格数(默认4行4列)
    VolumeState: true, //游戏音效状态(默认打开)
    GetGoalTime: 0, //达成游戏目标次数(默认0)
    CurrentGameMode: 0, //当前游戏模式(默认经典模式)
    haveCheat: false, //判断有没有使用过外挂模式(默认没有)
    getTableName: function () {
        if (this.CurrentGameMode == 0) {
            switch (this.GRIDColumnCount) {
                case 4:
                return Constant.TABLE_NAME_4;
                case 5:
                return Constant.TABLE_NAME_5;
                case 6:
                return Constant.TABLE_NAME_6;
                default:
                    return Constant.TABLE_NAME_4;
            }
        } else {
            return Constant.TABLE_NAME_INFINITE;
        }
    }
}


export default Config;